package com.rc.saas.mini.service.rc;

import com.rc.saas.mini.mapper.rc.RcChannelGainSettingMapper;
import com.rc.saas.mini.model.rc.RcChannelGainSetting;
import com.rc.saas.mini.model.rc.RcChannelGainSettingExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcChannelGainSettingServiceImpl implements RcChannelGainSettingService {
    @Autowired
    private RcChannelGainSettingMapper rcChannelGainSettingMapper;

    @Override
    public RcChannelGainSettingMapper getMapper() {
        return rcChannelGainSettingMapper;
    }

    @Override
    public List<RcChannelGainSetting> listByDefault() {
        RcChannelGainSettingExample example = new RcChannelGainSettingExample();
        example.createCriteria().andStatusEqualTo("0");
        example.setOrderByClause("sort");
        return rcChannelGainSettingMapper.selectByExample(example);
    }

    @Override
    public List<RcChannelGainSetting> listByDefaultWithChannelLevel(String channelLevel) {
        RcChannelGainSettingExample rcChannelGainSettingExample=new RcChannelGainSettingExample();
        rcChannelGainSettingExample.createCriteria().andChannelLevelEqualTo(channelLevel).andStatusEqualTo("0");
        return rcChannelGainSettingMapper.selectByExample(rcChannelGainSettingExample);
    }
}
